package com.hawthorn.admin.repository;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hawthorn.admin.model.po.SysDictPO;
import com.hawthorn.admin.repository.provider.SysDictSqlProvider;
import com.hawthorn.platform.repository.DBMapper;
import org.apache.ibatis.annotations.SelectProvider;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * <p>todo 字典管理数据层</p>
 * @author: guohao | 2607728024@qq.com
–
 * @created: 2022/7/1 11:39
 * @version v1.0.1
 * @copyright: Copyright (c) 2022 guohao
 */
@Repository
public interface SysDictMapper extends DBMapper<SysDictPO>
{

  @SelectProvider(SysDictSqlProvider.class)
  IPage<Map<String, Object>> selectDictList(String conditions, Page<Map<String, Object>> page);

  @SelectProvider(SysDictSqlProvider.class)
  IPage<Map<String, Object>> selectChildListByParent(String conditions, Page<Map<String, Object>> page);

  @SelectProvider(SysDictSqlProvider.class)
  List<SysDictPO> selectDictByParent(String parent);

  @SelectProvider(SysDictSqlProvider.class)
  List<Map<String, Object>> selectDictByCode(String dictCode);

  @SelectProvider(SysDictSqlProvider.class)
  List<Map<String, Object>> selectDictByWhere(String conditions);

  @SelectProvider(SysDictSqlProvider.class)
  Integer selectMaxParentCode();

  @SelectProvider(SysDictSqlProvider.class)
  Integer selectMaxChildCode(Integer parent);
}
